<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>产品购买</title>
    <link rel="stylesheet" href="__PUBLIC__/Theme1/css/goods_buy_AdminLTE.min.css">
    <link rel="stylesheet" href="__PUBLIC__/Theme1/css/goods_buy_style.css" type="text/css">
</head>
<style>
 .content{padding:0px;}   
</style>   
<body style="background: #fff;">
<div class="content-wrapper">

    <link href="__PUBLIC__/Theme1/css/goods_buy_style2.css" rel="stylesheet" type="text/css">
    <section class="content-header">
        <h1>
            产品订购
            <small>goods buy</small>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    <div class="tab-content">
                        <form method="post" name="goodsfrom" id="goodsfrom"
                              action="__APP__/Goods/goods_order/goods_id/<{$goods_info.goods_id}>">
                            <table class="sheet">
                                <tbody>
                                <tr>
                                    <th>编号</th>
                                    <th width="30%;">名称</th>
                                    <th>价格</th>
                                    <!-- <th>享受折扣</th> -->
                                    <!-- <th>可续天数</th> -->
                                    <th>数量</th>
                                </tr>
                                <tr class="mybg">
                                    <td><{$goods_info.goods_id}><input type="hidden" name="goods_id" value="<{$goods_info.goods_id}>"></td>
                                    <td style="  overflow:hidden;"><{$goods_info.goods_name}></td>
                                    <td class="red">¥ <{$goods_info.goods_price}> + <{$goods_info.goods_gwjf}> 积分</td>
                                    <!-- <td>无折扣</td> -->
                                    <!-- <td class="red"> <span id="goods_day"><{$goods_info.goods_day}></span></td> -->
                                    <td>
                                        <div class="change-goods-num clearfix changeGoodsNum">
                                            <a href="javascript:left_click($('#goods_number').val(),'<{$goods_info.goods_price}>','<{$goods_info.goods_gwjf}>')"><span
                                                    class="icon-common icon-common-add" style="line-height: 20px;">-</span></a>
                                            <input tyep="text" name="goods_number" value="1"
                                                   onblur="return _input(this);" class="goods-num"
                                                   id="goods_number">
                                            <a href="javascript:right_click($('#goods_number').val(),'<{$goods_info.goods_price}>','<{$goods_info.goods_gwjf}>')"><span
                                                    class="icon-common icon-common-add"  style="line-height: 20px;">+</span></a>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="shop-cart-count">
                                <div class="shop-cart-total">
                                    <p class="total-price">总计金额：<strong id="total-price">¥ <{$goods_info.goods_price}> + <{$goods_info.goods_gwjf}> 积分</strong></p>
                                </div>
                            </div>
                            <div class="xm-box row">
                                <div class="hd">
                                    <h2 class="title">收货地址<input type="hidden" name="takeid" id="takeid" value="">
                                    </h2>
                                    <div style="clear:both;"></div>
                                </div>
                                <div class="bd">
                                    <div class="xm-address-list">
                                        <dl class="selected">
                                            <dt><strong class="itemConsignee">收货人：<{$user_info.shouhuo_name}></strong> <span
                                                    class="itemTel">手机号码：<{$user_info.shouhuo_tel}></span></dt>
                                            <dd>
                                                <p class="itemStreet">收货地址：<{$user_info.address}> </p>
                                                <span class="icon-common icon-common-edit"><a
                                                        href="" style="color:red!important;">修改</a></span>
                                                <div style="clear:both; height:10px;"></div>
                                            </dd>
                                        </dl>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <input type="hidden" name="stopoutenable" id="stopoutenable"
                                   value="c3836c49cef32530fc3d6b3b1216beec">
                            <input type="submit" name="shop-cart-btns" id="shop-cart-btns" value="现在去结账"
                                   class="shop-cart-btns">
                            <!--<div class="shop-cart-btns nobtns">暂不订购了</div>-->

                        </form>
                        <div style="clear:both;"></div>

                    </div>
                </div>
            </div>
        </div>
    </section>


</div>
<script src="__PUBLIC__/Theme1/js/jquery.min.js"></script>
<script>
    function left_click(goods_number,goods_price,goods_gwjf){
        if(goods_number>1){
            $('#goods_number').val(goods_number-1);
            var g= $('#goods_number').val();
            var total_price=(goods_price*g).toFixed(2);
            var total_gwjf=(goods_gwjf*g).toFixed(2);
            $('#total_price').html(total_price+" + "+total_gwjf+" 积分");
            $('#total-price').html(total_price+" + "+total_gwjf+" 积分");
			
           /* var goods_day=(<{$goods_info.goods_day}>*g);
            $('#goods_day').html(goods_day); */
        }
    }
    function right_click(goods_number,goods_price,goods_gwjf){
            $('#goods_number').val(goods_number-(-1));
            var g= $('#goods_number').val();
            var total_price=(goods_price*g).toFixed(2);
            var total_gwjf=(goods_gwjf*g).toFixed(2);
            $('#total_price').html(total_price+" + "+total_gwjf+" 积分");
            $('#total-price').html(total_price+" + "+total_gwjf+" 积分");
          /*  var goods_day=(<{$goods_info.goods_day}>*g);
            $('#goods_day').html(goods_day);*/
    }
    function _input(obj){
        var number = $(obj).val();
        var _price = parseFloat($('#_price_').html());
        var price = parseFloat($('#price').html());
        if(!(number.match(/\D/)===null)){
            Wrong('购买数量请输入数字!');
            $(obj)[0].focus();
            $(obj).val('0');
            return false;
        }
        if(number<0){
            Wrong('请输入大于或等于零的数字!');
            $(obj)[0].focus();
            $(obj).val('0');
            return false;
        }
        getprice(obj);
    }
	function getprice($goods_number){
	
		var goods_price = "<{$goods_info.goods_price}>" ;
		var goods_gwjf = "<{$goods_info.goods_gwjf}>"
            var g= $('#goods_number').val();
            var total_price=(goods_price*g).toFixed(2);
            var total_gwjf=(goods_gwjf*g).toFixed(2);
            $('#total_price').html(total_price+" + "+total_gwjf+" 积分");
            $('#total-price').html(total_price+" + "+total_gwjf+" 积分");
	}
</script>

<!-- 结束 -->
</body>
</html>